from Base import message, intersect, SS_VALID
from DRG import MDCP_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["02.1202","03.5100x003","03.5200x003","07.2100","07.2102","17.3900x004","17.3901","31.7301","32.2001","32.2003","32.2903","32.2904","32.2905","32.3001","32.4100","32.4100x002","32.4902","32.4903","34.3x04","34.4x00x008","42.3100x001","42.3101","42.3201","44.6100x003","44.6500x003","45.3101","45.3301","45.3303","45.6100","45.7100x001","45.7900x002","45.7900x003","45.9100x006","45.9306","46.7901","49.7902","49.7903","49.7904","49.7905","49.7906","53.4901","53.7101","53.7201","53.7202","53.8000x001","53.8001","53.8002","53.8100x001","53.8101","53.8102","53.8103","53.9x05","54.1201","54.4x02","54.4x06","54.4x07","54.5903","54.7100","54.7200x002","54.7200x003","54.9500x005","54.9501","56.2x05","57.8600","65.2501","65.2901","65.3100","65.3900x001"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss and record.ageDay!=None and record.ageDay<29:
    message('符合PC1入组条件，匹配规则：主手术匹配、新生儿')

    if MDCP_DRG.PC19_group(record):
      return 'PC19'
        
    return 'PC1'
  else:
    return ''
    
